() [“./put.png”]

How income is distributed based on education and type

# education_devtype_salary <- res2018 %>%
#     filter(!is.na(DevType) & !is.na(Education)) %>%
#     filter(Education != "I never completed any formal education") %>%
#     separate_rows(DevType, sep = ";") %>%
#     group_by(Education, DevType) %>%
#     summarize(MedSalary = median(Salary))


# g <- ggplot(data = education_devtype_salary, aes(x = Education, y = MedSalary, group = DevType, color = DevType)) +
#     geom_line() +
#     scale_fill_brewer(palette = "Blues")
# g

# ggplotly(g)

How experience vs salary

Bar (x - experience) y(salary)

## Warning: There was 1 warning in `mutate()`.
## ℹ In argument: `Experience = discretize_experience(Experience)`.
## Caused by warning in `discretize_experience()`:
## ! NAs introduced by coercion
ggplot(exp_sal, aes(x = Experience, y = MedSalary, fill = year, color = year)) +
    geom_bar(stat = "identity", position = position_dodge(), width = 0.45)

# facet_wrap(~year)

Inflation plot

With inflation

Are admired languages well paid

admired18 <- res2018 %>%
    select(AdmiredLanguage, Salary) %>%
    separate_rows(AdmiredLanguage, sep = ";") %>%
    group_by(AdmiredLanguage) %>%
    summarize(SalaryMed = median(Salary), AdmiredLanguageCount = n())

g <- ggplot(admired18, aes(x = AdmiredLanguageCount, y = SalaryMed, color = AdmiredLanguage, fill = AdmiredLanguage)) +
    geom_jitter(show.legend = FALSE) +
    geom_text(
        aes(label = AdmiredLanguage),
        vjust = case_when(
            admired18$AdmiredLanguage == "Python" ~ 1.5,
            admired18$AdmiredLanguage == "CSS" ~ 1.8,
            admired18$AdmiredLanguage == "Visual Basic 6" ~ 1,
            admired18$AdmiredLanguage == "C++" ~ 1,
            admired18$AdmiredLanguage == "Perl" ~ 1,
            TRUE ~ -0.5
        ),
        hjust = -0.2,
        show.legend = FALSE
    ) +
    theme(legend.position = "none")

ggplotly(g)

Admired salary - language

Is it better to work in big companies?

Subplots x age_bin, and comparison of salaries per company size

company_levels <- c(
    "Freelancer",
    "2 to 9 employees",
    "Fewer than 10 employees",
    "10 to 19 employees",
    "20 to 99 employees",
    "100 to 499 employees",
    "500 to 999 employees",
    "1,000 to 4,999 employees",
    "5,000 to 9,999 employees",
    "10,000 or more employees"
)

company_salary18 <- res2018 %>%
    select(
        CompanySize, Salary, Experience
    ) %>%
    na.omit() %>%
    mutate(Experience = gsub(" years", "", Experience)) %>%
    mutate(Experience = factor(Experience, levels = experience_levels, ordered = TRUE)) %>%
    mutate(CompanySize = factor(CompanySize, levels = company_levels, ordered = TRUE)) %>%
    group_by(CompanySize, Experience) %>%
    # summarize(SalaryMed = format(median(Salary), scientific=FALSE))
    summarize(SalaryMed = median(Salary))
## `summarise()` has grouped output by 'CompanySize'. You can override
## using the `.groups` argument.
company_salary23 <- res2023 %>%
    select(
        CompanySize, Salary, Experience
    ) %>%
    na.omit() %>%
    filter(CompanySize != "I don’t know") %>%
    mutate(CompanySize = ifelse(CompanySize == "Just me - I am a freelancer, sole proprietor, etc.", "Freelancer", CompanySize)) %>%
    mutate(Experience = discretize_experience(Experience)) %>%
    mutate(Experience = gsub(" years", "", Experience)) %>%
    mutate(Experience = factor(Experience, levels = experience_levels, ordered = TRUE)) %>%
    mutate(CompanySize = factor(CompanySize, levels = company_levels, ordered = TRUE)) %>%
    group_by(CompanySize, Experience) %>%
    summarize(SalaryMed = median(Salary))
## Warning: There was 1 warning in `mutate()`.
## ℹ In argument: `Experience = discretize_experience(Experience)`.
## Caused by warning in `discretize_experience()`:
## ! NAs introduced by coercion
## `summarise()` has grouped output by 'CompanySize'. You can override
## using the `.groups` argument.
ggplot(company_salary18, aes(x = CompanySize, y = SalaryMed, fill = CompanySize), format(y, scientific = FALSE)) +
    geom_bar(stat = "identity") +
    facet_wrap(~Experience) +
    scale_y_continuous(labels = scales::comma, breaks = seq(0, 200000, 25000)) +
    theme(
        axis.text.x = element_blank(),
        axis.ticks.x = element_blank()
    )

ggplot(company_salary23, aes(x = CompanySize, y = SalaryMed, fill = CompanySize), format(y, scientific = FALSE)) +
    geom_bar(stat = "identity") +
    facet_wrap(~Experience) +
    scale_y_continuous(labels = scales::comma, breaks = seq(0, 200000, 25000)) +
    theme(
        axis.text.x = element_blank(),
        axis.ticks.x = element_blank()
    )

Are differences statistically significant?

Wher to work?

Map of the world with colored salaries

Best paying countries

Of course salary depends greatly on the country you work with.

## Warning in geom_map(data = WorldData, map = WorldData, aes(x = long, y =
## lat, : Ignoring unknown aesthetics: x and y

As shown above, the countries which stand out are USA, switzerland and Australia